<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS浮动</title>
    <style>
        div{
            width: 200px;
            height: 200px;
        }

        /*浮动：脱离原本的文档流 */
        .d1{
            background-color: cadetblue;
            /* 左浮 */
            float: left;
        }

        .d2{
            background-color: pink;
            /* 右浮 */
            float: right;
        }

        .clear{
            border-top: 3px solid orange;
            /* 清除浮动 left right both */
            clear: both;
        }

        /* 无序列表li元素的样式 */
        li{
            list-style: none;
            float: left;
            margin-left: 30px;
        }
    </style>
</head>
<body>
    <div class="d1"></div>
    <div class="d2"></div>
    <div class="clear"></div>

    <ul>
        <li>1111</li>
        <li>2222</li>
        <li>3333</li>
    </ul>
</body>
</html>